第 7步:我们已经准备好编写我们的get_user_input函数了!让我们向用户询问一些星星。
input()将用户的输入作为string返回。要将输入用作数字,我们需要将其转换为integer 。
- 在, 拖动Input an Integer在get_user_input()中缩进。
- 更改"How old are you?"到"How many stars should there be?" .
- 然后,将=符号左侧的变量从my_var为number 。
To navigate the page using the TAB key, first press ESC to exit the code editor.